@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@500;700&display=swap");

/* ==================================================
   STYLE COMMUN : palette, polices, navigation, pied de page, icônes
   (à relier sur TOUTES les pages)
================================================== */

/* ---------- 0. PALETTE ET POLICES (modifiables ici, une seule fois) ---------- */

:root {
    /* Couleurs de marque */
    --ab-vert: #176b38;
    --ab-vert-fonce: #10542b;
    --ab-vert-clair: #c2e091;
    /* fond du menu */
    --ab-vert-pale: #eaf5ed;
    /* pastilles, survols */
    --ab-menthe: #75d5a1;
    --ab-menthe-clair: #a8e6b7;
    --ab-bleu-nuit: #102d55;
    --ab-bleu-nuit-2: #0a1f3c;
    /* Palette « labo hybride » */
    --ab-papier: #f4f7f0;
    /* fond des pages */
    --ab-papier-2: #eaf0e2;
    /* fond des sections alternées */
    --ab-ligne: #d9e2cf;
    /* bordures */
    --ab-citron: #c2e091;
    /* accent : boutons, icônes, surtitres */
    --ab-nav: var(--ab-papier);
    /* fond du menu */

    /* Textes et fonds */
    --ab-encre: #263247;
    --ab-texte: #172033;
    --ab-texte-doux: #687386;
    --ab-gris-clair: #cbd5e1;
    --ab-gris-moyen: #94a3b8;
    --ab-fond: #f5f8fc;
    --ab-blanc: #ffffff;
    --ab-bordure: #e5ebf2;

    /* Polices */
    --police-titre: "Space Grotesk", "Segoe UI", Arial, sans-serif;
    --police-texte: "Inter", "Segoe UI", Arial, sans-serif;
    --police-mono: "JetBrains Mono", "Consolas", "Courier New", monospace;
}


/* ---------- 1. STABILITÉ ET TYPOGRAPHIE DE BASE ---------- */

/* Réserve toujours la place de la barre de défilement :
   le menu ne se décale plus entre une page longue et une page courte */
html {
    scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
    html {
        overflow-y: scroll;
    }
}

/* Supprime la marge par défaut du navigateur + police du site */
body {
    margin: 0;
    font-family: var(--police-texte);
}

/* Empêche l'effet « élastique » en bord de page */
html,
body {
    overscroll-behavior: none;
}

h1,
h2,
h3,
h4 {
    font-family: var(--police-titre);
    letter-spacing: -0.01em;
}

h1 {
    letter-spacing: -0.02em;
}

button,
input,
select,
textarea {
    font-family: inherit;
}


/* ---------- 2. BARRE DE NAVIGATION ---------- */

.entete-site {
    width: 100%;
    min-height: 80px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px 5%;

    /* background-color: var(--ab-vert-clair);
    border-bottom: 1px solid var(--ab-bordure); */
    background-color: var(--ab-nav);
    border-bottom: 1px solid var(--ab-ligne);

    position: relative;
    z-index: 10;

    font-family: var(--police-texte);
    line-height: 1.6;
}

.entete-site,
.pied-site,
.entete-site *,
.pied-site * {
    box-sizing: border-box;
}

.entete-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.entete-logo img {
    width: 165px;
    height: 60px;
    object-fit: contain;
    display: block;
}

.entete-nav ul {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.lien-site {
    display: inline-block;
    padding: 8px 0;

    color: var(--ab-encre);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;

    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.lien-site:hover,
.lien-site.active {
    color: var(--ab-encre);
    border-bottom-color: var(--ab-vert);
}

/* Bouton ☰ (caché sur ordinateur) */
.entete-burger {
    display: none;

    width: 44px;
    height: 44px;
    padding: 0;

    background: transparent;
    border: 2px solid var(--ab-encre);
    border-radius: 8px;
    cursor: pointer;

    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.entete-burger span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--ab-encre);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.entete-burger:focus-visible {
    outline: 3px solid var(--ab-vert);
    outline-offset: 2px;
}

.entete-site.ouvert .entete-burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.entete-site.ouvert .entete-burger span:nth-child(2) {
    opacity: 0;
}

.entete-site.ouvert .entete-burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ---------- 3. PIED DE PAGE ---------- */

.pied-site {
    padding: 50px 7% 22px;

    background-color: var(--ab-bleu-nuit);
    color: var(--ab-blanc);

    font-family: var(--police-texte);
    line-height: 1.6;
}

.pied-contenu {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;

    max-width: 1200px;
    margin: 0 auto 35px;
}

.pied-logo {
    display: inline-block;
    margin-bottom: 18px;
    padding: 8px 14px;

    background-color: var(--ab-vert-clair);
    border-radius: 10px;
    text-decoration: none;
}

.pied-logo img {
    width: 150px;
    height: 54px;
    object-fit: contain;
    display: block;
}

.pied-marque p {
    max-width: 420px;
    margin: 0;

    color: var(--ab-gris-clair);
    font-size: 13px;
    line-height: 1.9;
}

.pied-liens {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pied-liens h4 {
    margin: 0 0 14px;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.pied-liens a {
    margin-bottom: 9px;

    color: var(--ab-gris-clair);
    font-size: 14px;
    text-decoration: none;

    transition: color 0.3s ease;
}

.pied-liens a:hover {
    color: var(--ab-menthe);
}

.pied-bas {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 20px;

    border-top: 1px solid rgba(255, 255, 255, 0.15);

    color: var(--ab-gris-clair);
    font-size: 12px;
    text-align: center;
}

.pied-bas p {
    margin: 0;
}

.pied-bas p+p {
    margin-top: 4px;
    color: var(--ab-gris-moyen);
}


/* ---------- 4. ICÔNES SVG ---------- */

.ico {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    vertical-align: -0.15em;
}

/* Pastilles d'icônes : vert de la charte */
.ressource_icone,
.contact_icone,
.conseil_icone,
.ressources_vide_icone {
    color: var(--ab-vert);
}

/* Icône placée devant un texte (menu, onglets, titres) */
.icone-texte {
    margin-right: 0.4em;
}

.icone-texte:empty {
    display: none;
}

.lien-site .icone-texte {
    font-size: 18px;
}


/* ---------- 5. ÉTIQUETTES TECHNIQUES (police mono) ---------- */

/* Surtitres : « APPRENDRE • COMPRENDRE », « DOMAINE I », « CONSEILS »... */
.hero_tag,
.petit_titre,
.surtitre,
.categorie,
.lexique_surtitre,
.ressources_surtitre,
.conseils_surtitre,
.contact_surtitre,
.conseil_categorie {
    font-family: var(--police-mono);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.14em;
}

/* Petites données : numéros, comptes, pagination, détails */
.numero,
.numero-module,
.nombre-modules,
.pied_carte>span,
.pagination-numero,
.lexique_anglais,
.lexique_cat,
.lexique_compteur,
.recherche_info,
.ressource_infos,
.contact_detail {
    font-family: var(--police-mono);
    font-weight: 500;
    letter-spacing: 0.02em;
}


/* ---------- 6. TABLETTES ---------- */

@media screen and (max-width: 1000px) {

    .entete-site {
        padding: 10px 3%;
    }

    .entete-nav ul {
        gap: 18px;
    }
}

@media screen and (max-width: 900px) {

    .pied-contenu {
        grid-template-columns: 1fr 1fr;
    }

    .pied-marque {
        grid-column: 1 / -1;
    }
}


/* ---------- 7. TÉLÉPHONES : menu « hamburger » ---------- */

@media screen and (max-width: 860px) {

    .entete-site {
        flex-wrap: wrap;
        padding: 10px 5%;
    }

    .entete-burger {
        display: flex;
    }

    /* Le menu est caché tant qu'on n'appuie pas sur ☰ */
    .entete-nav {
        display: none;
        width: 100%;
        padding: 6px 0 10px;
    }

    .entete-site.ouvert .entete-nav {
        display: block;
    }

    .entete-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .entete-nav li {
        border-top: 1px solid rgba(38, 50, 71, 0.15);
    }

    .lien-site {
        display: block;
        padding: 13px 4px;
        font-size: 16px;
        border-bottom: none;
    }

    .lien-site.active {
        border-bottom: none;
    }

    .entete-nav li:last-child {
        padding-top: 12px;
    }

    /* Contact : affiché comme un bouton centré */
    .lien-site.lien-bouton {
        text-align: center;
        padding: 13px 20px;
    }
}

@media screen and (max-width: 600px) {

    .entete-logo img {
        width: 145px;
        height: 50px;
    }

    .pied-contenu {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}